package org.dromara.solonplugins.j2cache.test2;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.noear.solon.annotation.Inject;
import org.noear.solon.test.SolonJUnit5Extension;
import org.noear.solon.test.SolonTest;

import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.CacheObject;

@ExtendWith(SolonJUnit5Extension.class)
@SolonTest(TestApp2.class)
public class DemoTest2 {

	@Inject
    private CacheChannel cacheChannel;
	
	@Test
	public void test() {
		String region = "jre_t";
		String name = "name_t";
		String val = "val_t";
		cacheChannel.set(region,name,val);
		
		 CacheObject cacheObject = cacheChannel.get(region, name);
		 if(cacheObject!= null){
			 System.out.println(cacheObject.getValue());
		 }
		 
//		 cacheChannel.evict(region, name);
//		 cacheChannel.clear(region);
	}
	
}
